﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="products.aspx.cs" Inherits="ProductManager_products" %>
<%@ Register Src="../extends/RecordControl.ascx" TagName="RecordControl" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <script src="../kindeditor.js" type="text/javascript"></script>
        <script charset="utf-8" src="../kindeditor-min.js" type="text/javascript"></script>
        <script charset="utf-8" src="../lang/zh_CN.js" type="text/javascript"></script>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="../css/css.css" type="text/css" rel="stylesheet"/>
         <link rel="stylesheet" href="../themes/default/default.css" />
        <script src="../javascript/jscript.js" type="text/javascript"></script>
     
        <title>产品管理</title>
        
        <script type="text/javascript">

        function SelectItemed(ctrlID,operateIndex,recordID)
       {
             if(operateIndex==1)
            {
               __doPostBack('<%= hideButton.UniqueID%>',recordID);
                return;
            }
            if(operateIndex==0)
            {
            
                window.location="AddProduct.aspx?ID="+recordID;
                return;
            }
            if(operateIndex==2||operateIndex==3||operateIndex==4||operateIndex==5||operateIndex==6)
            {
            
             var act="0|"+operateIndex+"|"+recordID;
             __doPostBack('<%= Button1.UniqueID%>',act);
            }
       }
        function UnSelectItemed(ctrlID,operateIndex,recordID)
       {
             if(operateIndex==2||operateIndex==3||operateIndex==4||operateIndex==5||operateIndex==6)
            {
             var act="1|"+operateIndex+"|"+recordID;
             __doPostBack('<%= Button1.UniqueID%>',recordID);
            }
       }
        </script>
    
</head>
<body>
  <table class='table' cellspacing='1' cellpadding='3' width="98%" align='center' border='0'>
          <tbody>
            <tr>
              <td class='xingmu'>产品管理</td>
            </tr>
                
             <tr>
                  <td class="hback"> 
                  &nbsp;&nbsp;<a href="AddProduct.aspx">添加产品</a>
                  </td>
             </tr>
    
          </tbody>
        </table>

    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                    <asp:Button ID="hideButton" runat="server" Text="BAODAP"     style="display:none" OnClick="hideButton_Click"/>
                     <asp:Button ID="Button1" runat="server" Text="setting"     style="display:none" OnClick="Button1_Click"/>
                    <uc1:RecordControl ID="RecordControl1" runat="server" mainKey="Q.ID" hideKey="KPID,NID,销售类型" OperateSet="修改,删除,推荐|销售类型|精品推荐,热卖|销售类型|热卖商品,最新|销售类型|最新商品,强力推荐|KPID|1,推广|NID|1" Query="SELECT Q.PID AS PID,Q.NAME AS 产品名称,Q.SALETYPE AS 销售类型,Q.STOCK_SUM AS 库存数量,Q.WEIGHT AS 重量,Q.MARKETPRICE AS 市场价,Q.PRICE AS 价格,Q.DISCOUNT AS 折扣率,
iif(Q.KPID is null, '0', '1') AS KPID,iif(N.PID is null, '0', '1') AS NID FROM 
(SELECT T.ID,t.PID AS PID,t.NAME,t.SALETYPE,t.STOCK_SUM,t.WEIGHT,t.MARKETPRICE,t.PRICE,t.DISCOUNT,K.PID AS KPID FROM T_PRODUCT AS t LEFT JOIN T_RECOMMEND AS k on t.PID=k.PID) Q  LEFT JOIN T_PRODUCT_PROMOTION N ON Q.PID=N.PID" pageSize="15" where=" NAME "/>
                  </ContentTemplate>
            </asp:UpdatePanel>
      </div>
    </form>

</body>
</html>
